
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
A JSON parser that can parse "bad" JSON. Mostly, this is about avoiding the need to quote everything!
Strict JSON requires you to do this:
{ "foo":"bar", "red":1 }
The JavaScript language itself is a little easier:
{ foo:"bar", red:1, }
But if you really want to be lazy, jsonic lets you say:
foo:bar, red:1,
See below for the relaxed JSON rules.
This module is used by the Seneca framework to provide an abbreviated command syntax.
If you're using this module, feel free to contact me on twitter if you have any questions! :) @rjrodger
var jsonic = require('jsonic')
// parse a string into a JavaScript object
var obj = jsonic('foo:1, bar:zed')
// prints { foo: 1, bar: 'zed' }
console.dir( obj )
npm install jsonic
JSONIC format is just standard JSON, with a few rule relaxations:
{ foo:"bar baz", red:255 }
foo:"bar baz", red:255
foo:bar baz, red:255
icky:",}]"
Jules:'Cry "Havoc," and let slip the dogs of war!'
foo:bar, red:255,
The jsonic module provides a stringify
method:
console.log( jsonic.stringify( {a:"bc",d:1} ) ) // prints {a:bc,d:1}
The stringify
method converts a plain JavaScript object into a
string that can be parsed by jsonic. It has two parameters:
value
: plain objectoptions
: optional options objectFor example, you can limit the depth of the object tree printed:
console.log( jsonic.stringify( {a:{b:{c:1}}}, {depth:2} ) ) // prints {a:{b:{}}}
NOTE: jsonic.stringify
is intended for debug printing, not data exchange, so the defaults are conservative in the amount of data printed
The options are:
The parser uses PEG.js and is an extension of the example JSON parser included in that project.
FAQs
A dynamic JSON parser that isn't strict and can be customized.
The npm package jsonic receives a total of 23,365 weekly downloads. As such, jsonic popularity was classified as popular.
We found that jsonic demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.